package arithmetic.tree;

/**
 * @Author: Beating Pupils
 * @Date: 2021/1/12 7:09
 * @Description:
 */
public class TreeTest {

    // Definition for a binary tree node.
    public class TreeNode {
        int val;
        TreeNode left;
        TreeNode right;

        TreeNode()        {}

        TreeNode(int val) { this.val = val; }

        TreeNode(int val, TreeNode left, TreeNode right) {
            this.val = val;
            this.left = left;
            this.right = right;
        }
    }

    class Solution {
        public void rotate(int[][] matrix) {
            int length=matrix.length;
            if(length==1){
                return;
            }
            int[][] arry=new int[length][length];
            for(int i =0;i<length;i++){
                for(int j =0;j<length;j++){
                    arry[j][length-i]=matrix[i][j];
                }
            }
            //在赋值回去
            for(int i =0;i<length;i++){
                for(int j =0;j<length;j++){
                    matrix[i][j]=matrix[i][j];
                }
            }
        }
    }
}
